package com.example.guardian.personalcenter;

import androidx.lifecycle.ViewModelProvider;

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;

import com.example.guardian.R;

public class PersonalCenterFragment extends Fragment {

    private PersonalCenterViewModel mViewModel;

    public static PersonalCenterFragment newInstance() {
        return new PersonalCenterFragment();
    }

    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.personal_center_fragment, container, false);

        LinearLayout system_seting = view.findViewById(R.id.system_seting);
        LinearLayout feedback_help = view.findViewById(R.id.feedback_help);
        LinearLayout about_software = view.findViewById(R.id.about_software);

        system_seting.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), SystemSeting.class);
                startActivity(intent);
            }
        });
        feedback_help.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), FeedbackHelp.class);
                startActivity(intent);
            }
        });
        about_software.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), AboutSoftware.class);
                startActivity(intent);
            }
        });
        return view;


    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mViewModel = new ViewModelProvider(this).get(PersonalCenterViewModel.class);
        // TODO: Use the ViewModel
    }

}